const Mock = require('mockjs')
    //雷达图
Mock.mock(
        RegExp(`/heima\/radar` + ".*"),
        'get',
        (options) => {
            return Mock.mock({
                success: true,
                message: '',
                ['list|3']: [{
                    name: "@name",
                    'value|6': ['@integer(1000, 2000)']
                }]

            })
        }
    )
    //柱状图
Mock.mock(
    RegExp(`/heima\/barchart` + ".*"),
    'get',
    (options) => {
        let data = Mock.mock({
            "data|1": [{
                "value|7": ['@integer(100, 400)'],
            }],
            "list|1": [{
                "value|7": ['@integer(100, 400)'],
            }],
            "arr|1": [{
                "value|7": ['@integer(100, 400)'],
            }],

        })
        return data
    })

//第二个柱状图
Mock.mock(
    RegExp(`/heima\/zhu` + ".*"),
    'get',
    (options) => {
        let data = Mock.mock({
            "data|1": [{
                "value|8": ['@integer(50, 300)'],
            }],
            "list|1": [{
                "value|8": ['@integer(50, 300)'],
            }],
            "arr|1": [{
                "value|8": ['@integer(50, 300)'],
            }],

        })
        return data
    })

//折线图
Mock.mock(
    RegExp(`/heima\/polyline` + ".*"),
    'get',
    (options) => {
        let data = Mock.mock({
            "data|1": [{
                "value|14": ['@integer(50, 200)'],
            }],
            "list|1": [{
                "value|14": ['@integer(20, 200)'],
            }],

        })
        return data
    })

//饼图
Mock.mock(RegExp(`/heima\/pie` + ".*"), "get", (options) => {
    let data = Mock.mock({
        "data|5": [{
            "value|10-100": 100,
            "name|+1": [
                "Introction",
                "Froecasts",
                "Forex",
                "Gold",
                "Technology",
            ],
        }]
    })
    return data
})

Mock.mock(RegExp(`/heima\/tabtu` + ".*"), "get", (options) => {
        let data = Mock.mock({
            data: [
                '@integer(10, 60)',
            ]
        })
        return data
    })
    //最后一个饼图
Mock.mock(RegExp(`/heima\/bin` + ".*"), "get", (options) => {
    let data = Mock.mock({
        "data|8": [{
            "value|100-1000": 1000,
            "name|+1": [
                "百度",
                "直达",
                "邮件营销",
                "谷歌",
                "联盟广告",
                "必应",
                "视频广告",
                "其他",

            ],
        }],
        "list|3": [{
            "value|100-1000": 1000,
            "name|+1": ["搜索引擎",
                "营销广告",
                "直达"
            ]
        }]
    })
    return data
})

//表格
Mock.mock(RegExp(`/heima\/search` + ".*"), "get", (options) => {
    let data = Mock.mock({
        "data|15": [{
            "number|300-800": 800,
            name: "@cname",
            "value|10-90": 90,

        }]
    })
    return data
})